package net.pimpas.security.jaas.serviceprovider.auth.login.callback;

import java.io.IOException;

import net.pimpas.security.serviceprovider.auth.login.callback.Callback;
import net.pimpas.security.serviceprovider.auth.login.callback.CallbackHandler;
import net.pimpas.security.serviceprovider.auth.login.callback.UnsupportedCallbackException;

public abstract class JAASCallbackHandler implements CallbackHandler, javax.security.auth.callback.CallbackHandler {
	
	public abstract void handle(Callback... callbacks) throws IOException, UnsupportedCallbackException;
	
	public void handle(javax.security.auth.callback.Callback[] callbacks) throws IOException, javax.security.auth.callback.UnsupportedCallbackException {
		Callback[] backs = new Callback[callbacks.length];
		for(int i=0;i<callbacks.length;i++)
			backs[i] = (Callback) callbacks[i];
		
		this.handle(backs);
	}
}